<?php

function model_profiles($bdd) {

    $results = $bdd->query('SELECT * FROM `users`');

    return $results;
}

function model_profiles_works($bdd, $id_user) {

    $results = $bdd->query('SELECT * FROM works
           WHERE user_id = ' . $id_user . '');

    return $results;
}

function model_one_profile($bdd, $details) {

    $results = $bdd->query('SELECT * FROM `users`
            WHERE id_user=' . $details . '');

    return $results;
}

function model_one_profile_works($bdd, $id_user, $details) {

    $results = $bdd->query('SELECT work_name,id_work FROM `works`
           WHERE user_id = ' . $id_user . '');

    return $results;
}

?>
